<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var n=parseInt(prompt("请输入数字n"));
        var a=parseInt(prompt("请输入数字a"));
        var sum=0;
        var num=0;
        for(var m=1;m<=n;m++){
            num=(num*10+a);
            sum+=num;
        }
        document.write(sum);
    </script>
</body>
</html>